program StretchAndRotate;

uses
  Windows, SysUtils,
  S2DMain, S2DTypes, S2DSWCanvas;

var
  Stretch,
  Sprite: TBuffer;
  Angle : Single;
  I     : Byte;

begin
  InitWindow(1024, 768);
  LoadBMP(Sprite, 'IMAGES\Akarin.BMP');
  InitBuffer(Stretch, 1024, 200);
  StretchBuffer(Stretch, Sprite, 0, 0, 1024, 200);
  ShowCursor(FALSE);
  repeat
    ClearBuffer(Screen, 0);
    PutBuffer(Screen, Stretch, 0, 0);
    PutBuffer(Screen, Stretch, 0, 567);
    RotateBuffer(Screen, Sprite, 412, 309, Round(Angle));
    Angle:= Angle+FrameTime/15;
    SysText(Screen, 10, 379, 'FPS        : '+IntToStr(S2DInfo.FPS), $00FF00);
    SysText(Screen, 10, 389, 'Memory used: '+IntToStr(S2DInfo.TotalAllocMemory)+' bytes', $FFFFFF);
    GetMessages;
  until NOT S2DInfo.Running OR KeyMap[VK_ESCAPE];
  FreeBuffer(Sprite);
  CloseWindow;
end.

